<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="" autocomplete="off">
    <div class="form-group" id="groupid">
        <label class="control-label col-xs-12 col-sm-2">{:__('班号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-org_cate_id" class="form-control" name="row[parent_id]" onchange="change_group(this)">
                {foreach name="orgName_tree" item="vo"}
                <option value="{$key}" >{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group layer-footer">
        <input type="hidden" id="gropuid" name="groupid" value="{$groupid}">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" href="javascript:;" class="btn btn-info btn-import {:$auth->check('user/userinput/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="user/userinput/import?ids={$ids}" data-mimetype="csv" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</button>
            <a href="/template/userimport.csv"  target="_blank" id="stud" class="btn btn-info">学生和家长导入模版</a>
        </div>
    </div>
</form>
<script>
    function change_group(obj){
        var gropuid = $(obj).val();
        $('#gropuid').val(gropuid);
        change_url();
    }
    // change_url();
    function change_url()
    {
        var gropuid = $('#gropuid').val();
        $.ajax({
            url:'user/userinput/setsess',
            data: {gropuid:gropuid},
            type:'POST',
            dataType: "json",
            success: function (res) {
               console.log(res);
            }
        });
    }
</script>
